package com.woniuxy.util;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseObj {
    private Integer code;
    private String msg;
    private Object data;
    public static ResponseObj ok(){
        return new ResponseObj(200,"成功","null");
    }

    public static ResponseObj ok(Object data){
        return new ResponseObj(200,"成功",data);
    }


    public static ResponseObj erreo(){
        return new ResponseObj(500,"失败","null");
    }

    public static ResponseObj erreo(Object data){
        return new ResponseObj(500,"失败",data);
    }

    public ResponseObj code(Integer code){
        this.code=code;
        return this;
    }

    public ResponseObj msg(String msg){
        this.msg=msg;
        return this;
    }

    public ResponseObj date(Object data){
        this.data=data;
        return this;
    }
}
